From: Øyvind Kolås Date: Mon, 3 Dec 2018 23:04:45 +0000 (+0100) Subject: cairo: move CMYK extension formats here X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~12^2~21 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=690169bb68089247f0b096a431db891a1855e3ea;p=babl.git cairo: move CMYK extension formats here This adds new endian-aware formats cairo-ACMK32 and cairo-ACKY32 which are derived from babl_format("camayakaA u8") - converting succesively with these two formats to this format or other sharing the model permits rebuilding a complete CMYKA image. --- diff --git a/extensions/cairo.c b/extensions/cairo.c index 9a96fc3..e10f384 100644 --- a/extensions/cairo.c +++ b/extensions/cairo.c @@ -529,5 +529,71 @@ init (void) NULL ); + + /* formats that distribute different subset of the additive mixing variants + * of CMYK producing two syntetic RGB formats we run in parallel to derive + * a 4 instead of 3 component result, the same method could be used to + * extend processing/drawing with cairo to spectral data. + */ + if (littleendian) + { + babl_format_new ("name", "cairo-ACMK32", + babl_model ("camayakaA"), + babl_type ("u8"), + babl_component ("ka"), + babl_component ("ma"), + babl_component ("ca"), + babl_component ("A"), + NULL); + babl_format_new ("name", "cairo-ACKY32", + babl_model ("camayakaA"), + babl_type ("u8"), + babl_component ("ya"), + babl_component ("ka"), + babl_component ("ca"), + babl_component ("A"), + NULL); + } + else + { + babl_format_new ("name", "cairo-ACMK32", + babl_model ("camayakaA"), + babl_type ("u8"), + babl_component ("A"), + babl_component ("ca"), + babl_component ("ma"), + babl_component ("ka"), + NULL); + babl_format_new ("name", "cairo-ACKY32", + babl_model ("camayakaA"), + babl_type ("u8"), + babl_component ("A"), + babl_component ("ca"), + babl_component ("ka"), + babl_component ("ya"), + NULL); + } + + /* companion subset formats for setting pango u16 RGB color values from cmykA + * */ + babl_format_new ("name", "ckyA u16", + babl_model ("cmykA"), + babl_type ("u16"), + babl_component ("cyan"), + babl_component ("key"), + babl_component ("yellow"), + babl_component ("A"), + NULL); + babl_format_new ("name", "cmkA u16", + babl_model ("cmykA"), + babl_type ("u16"), + babl_component ("cyan"), + babl_component ("magenta"), + babl_component ("key"), + babl_component ("A"), + NULL); + + + return 0; } diff --git a/extensions/naive-CMYK.c b/extensions/naive-CMYK.c index 1e1c905..de93fa8 100644 --- a/extensions/naive-CMYK.c +++ b/extensions/naive-CMYK.c @@ -37,58 +37,6 @@ int init (void); int init (void) { - babl_format_new ("name", "ckyA u16", - babl_model ("cmykA"), - babl_type ("u16"), - babl_component ("cyan"), - babl_component ("key"), - babl_component ("yellow"), - babl_component ("A"), - NULL); - babl_format_new ("name", "cmkA u16", - babl_model ("cmykA"), - babl_type ("u16"), - babl_component ("cyan"), - babl_component ("magenta"), - babl_component ("key"), - babl_component ("A"), - NULL); - - babl_format_new ("name", "camakaA u8", - babl_model ("camayakaA"), - babl_type ("u8"), - babl_component ("ka"), - babl_component ("ma"), - babl_component ("ca"), - babl_component ("A"), - NULL); - babl_format_new ("name", "cakayaA u8", - babl_model ("camayakaA"), - babl_type ("u8"), - babl_component ("ya"), - babl_component ("ka"), - babl_component ("ca"), - babl_component ("A"), - NULL); - babl_format_new ("name", "camaPadkaA u8", - babl_model ("camayakaA"), - babl_type ("u8"), - babl_component ("ca"), - babl_component ("ma"), - babl_component ("PAD"), - babl_component ("ka"), - babl_component ("A"), - NULL); - babl_format_new ("name", "caPadyakaA u8", - babl_model ("camayakaA"), - babl_type ("u8"), - babl_component ("ca"), - babl_component ("PAD"), - babl_component ("ya"), - babl_component ("ka"), - babl_component ("A"), - NULL); - return 0; }